home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_097 / shm / shm_manual.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  135 lines

  1. /************************************************************************
  2.                            Manual Requester                 8th August 87
  3. ************************************************************************/
  4. #include <intuition/intuition.h>
  5.  
  6. #include "shm_defines"
  7.  
  8. extern struct TextAttr Fnt;
  9.  
  10. /************************************************************************
  11.                            Manual Definitions
  12. ************************************************************************/
  13. struct IntuiText manual_continue_txt =
  14.        {1, 0, JAM1, 8, 2, &Fnt, (UBYTE *)"Continue", NL};
  15.  
  16. struct IntuiText itxt[] =
  17. {
  18. {1, 0, JAM1, 20, 5, &Fnt,
  19. "  This program approximately simulates the motion of two interacting",
  20. &itxt[1]},
  21. {1, 0, JAM1, 20, 15, &Fnt,
  22. "pendulums. It was written as an exercise in learning Lattice C and",
  23. &itxt[2]},
  24. {1, 0, JAM1, 20, 25, &Fnt,
  25. "Intuition on the Amiga.",
  26. &itxt[3]},
  27. {1, 0, JAM1, 20, 35, &Fnt,
  28. "  If you change the parameter settings it is neater if you 'Halt' 'Reset'",
  29. &itxt[4]},
  30. {1, 0, JAM1, 20, 45, &Fnt,
  31. "and 'Erase' before 'Drawing' with the new values. The horizontal and",
  32. &itxt[5]},
  33. {1, 0, JAM1, 20, 55, &Fnt,
  34. "vertical 'Centre' and 'Size' parameters do what you expect. The phase",
  35. &itxt[6]},
  36. {1, 0, JAM1, 20, 65, &Fnt,
  37. "parameters influence the initial directions of motion. Frequencies close to",
  38. &itxt[7]},
  39. {1, 0, JAM1, 20, 75, &Fnt,
  40. "integers or simple fractions give the most interesting results. 'Coupling'",
  41. &itxt[8]},
  42. {1, 0, JAM1, 20, 85, &Fnt,
  43. "relates to the relative weights of the two pendulums.",
  44. &itxt[9]},
  45. {1, 0, JAM1, 20, 95, &Fnt,
  46. "  References which helped with the learning process include :-",
  47. &itxt[10]},
  48. {1, 0, JAM1, 20, 105, &Fnt,
  49. "  'The C Programming language' B.W.Kernighan and D.M.Ritchie. Prentice-Hall",
  50. &itxt[11]},
  51. {1, 0, JAM1, 20, 115, &Fnt,
  52. "  'Intuition Reference Manual' R.J.Mical and S.Deyl. Addison-Wesley",
  53. &itxt[12]},
  54. {1, 0, JAM1, 20, 125, &Fnt,
  55. "  'Inside Amiga Graphics' S.Leemon. Compute! Publications",
  56. &itxt[13]},
  57. {1, 0, JAM1, 20, 135, &Fnt,
  58. "  'Fundamentals of C' M.L.Van Name and W.B.Catchings. Amiga World 86/87",
  59. &itxt[14]},
  60. {1, 0, JAM1, 20, 145, &Fnt,
  61. "  'Intuition Gadgets' H.M.Tolly. Amazing Computing Vol2 #3, 5 and 7",
  62. &itxt[15]},
  63. {1, 0, JAM1, 20, 155, &Fnt,
  64. "  Lattice C Compiler Manual V3.1  and L.Trimble's C sig, Amicue, Edmonton",   
  65. &itxt[16]},
  66. {1, 0, JAM1, 20, 167, &Fnt,
  67. "    Chris Ediss, 792 Birch Avenue, Sherwood Park, Alberta T8A 1X1, Canada",
  68. &itxt[17]},
  69. {1, 0, JAM1, 20, 177, &Fnt,
  70. "       Tel 403-467-2392, CEDISS@UALTAVM (PROFS), CEO9 MTS UofA.",
  71. NL}
  72. };
  73.  
  74. struct Image manual_continue_img = {0,0, 80,11, 1, NL, 0, 2, NL};
  75.  
  76. struct Gadget manual_continue_gad =
  77. {
  78. NL,
  79. 554, 176, 80, 11,
  80. GADGHBOX | GADGIMAGE, RELVERIFY | ENDGADGET,
  81. BOOLGADGET | REQGADGET,
  82. (APTR)&manual_continue_img, NL,
  83. &manual_continue_txt,
  84. NL, NL, 1, NL
  85. };
  86.  
  87. struct Requester manual_req;
  88.  
  89. SHORT manual_border_coords[] = {0,0, 639,0, 639,189, 0,189, 0,0};
  90.  
  91. struct Border manual_border =
  92. {
  93. 0, 0,
  94. 1, 0, JAM1,           /* White Border */
  95. 5, &manual_border_coords[0],
  96. NL
  97. };
  98.  
  99. /************************************************************************
  100.                              Manual Function
  101. ************************************************************************/
  102. manual(cW)
  103. struct Window *cW;
  104. {
  105. struct IntuiMessage *message;
  106. BOOL loop;
  107. int class;
  108.  
  109. InitRequester(&manual_req);
  110.  
  111. manual_req.LeftEdge = 0;
  112. manual_req.TopEdge = 10;
  113. manual_req.Width = 640;
  114. manual_req.Height = 190;
  115. manual_req.ReqGadget = &manual_continue_gad;
  116. manual_req.ReqText = &itxt[0];
  117. manual_req.BackFill = 3;
  118. manual_req.Flags = 0;
  119. manual_req.ReqBorder = &manual_border;
  120.  
  121. Request(&manual_req,cW);
  122.  
  123. loop = TRUE;
  124.  
  125. while (loop)
  126.       {
  127.       Wait(1 << cW->UserPort->mp_SigBit);
  128.       message = (struct IntuiMessage *) GetMsg(cW->UserPort);
  129.       class = message->Class;
  130.       ReplyMsg(message);
  131.       if (class == REQCLEAR) loop = FALSE;
  132.       }
  133. return(TRUE);
  134. }
  135.